// const { json } = require("express");

window.addEventListener('load',function(){
    var title = document.querySelector('#title');
    title.onkeydown = function(event){
        if(event.keyCode===13){
            var local  =getDate();
            // console.log(local);
            local.push({title:this.ariaValueMax,done:false})
            saveDate(local)
        }
    }
    function getDate(){
        var data = localStorage.getItem('todolist');
        if(data!=null){
            return JSON.parse(data)
        }else{
            return []
        }
    }
    function saveDate(data){
        localStorage.setItem('todolist',JSON.stringify(data))
    }
})